﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using VocabManager.Command;

namespace VocabManager.ViewModel
{
    public class WelcomeViewModel : ViewModelBase
    {
        public string Title
        {
            get 
            {
                return "Vocab Manager";
            }
        }


        #region Start App
        RelayCommand _startAppCommand;
        public ICommand StartAppCommand
        {
            get
            {
                if (_startAppCommand == null)
                {
                    _startAppCommand = new RelayCommand(
                        param => this.StartApp(),
                        param => this.CanStart()
                        );
                }
                return _startAppCommand;
            }
        }
        private bool CanStart()
        {
            return true;
        }

        private void StartApp()
        {
            App.Instance.MainPage.LoadDeckListView();
        }

        #endregion
        #region ShowHelp
        RelayCommand _showHelpCommand;
        public ICommand ShowHelpCommand
        {
            get
            {
                if (_showHelpCommand == null)
                {
                    _showHelpCommand = new RelayCommand(
                        param => this.ShowHelp(),
                        param => this.CanShowHelp()
                        );
                }
                return _showHelpCommand;
            }
        }
        private bool CanShowHelp()
        {
            return true;
        }

        private void ShowHelp()
        {
            App.Instance.MainPage.LoadHelpView();
        }

        #endregion
        #region ShowAbout
        RelayCommand _showAboutCommand;
        public ICommand ShowAboutCommand
        {
            get
            {
                if (_showAboutCommand == null)
                {
                    _showAboutCommand = new RelayCommand(
                        param => this.ShowAbout(),
                        param => this.CanShowAbout()
                        );
                }
                return _showAboutCommand;
            }
        }
        private bool CanShowAbout()
        {
            return true;
        }

        private void ShowAbout()
        {
            App.Instance.MainPage.LoadAboutView();
        }

        #endregion
    }
}
